/*
 * File Created: Thursday, 1st December 2022 2:49:37 pm
 * Author: hotsuitor (hotsuitor@qq.com)
 * -----
 * Last Modified: Thursday, 1st December 2022 3:29:07 pm
 * Modified By: hotsuitor (hotsuitor@qq.com>)
 * -----
 * Copyright 2022 - 2022 Your Company, Your Company
 */

package main

import (
	"image"
	"image/color"

	"golang.org/x/tour/pic"
)

type Image struct{}

func (i Image) ColorModel() color.Model {
	return color.RGBAModel
}
func (i Image) Bounds() image.Rectangle {
	return image.Rect(0, 0, 200, 200)
}
func (i Image) At(x, y int) color.Color {
	return color.RGBA{uint8(x), uint8(y), uint8(255), uint8(255)}
}
func Pic(dx, dy int) [][]uint8 {
	result := make([][]uint8, dy)
	for y := 0; y < dy; y++ {
		tmp := make([]uint8, dx)
		for x := 0; x < dx; x++ {
			tmp[x] = uint8((x + y) / 2)
		}
		result[y] = tmp
	}
	return result
}
func main() {
	// pic.Show(Pic)
	m := Image{}
	pic.ShowImage(m)
}
